#include "bid.h"
#include "ui_bid.h"
#include <string>
#include<QtCore>
bid::bid(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::bid)
{
    ui->setupUi(this);
    num="0";
    suit="0";
}

bid::~bid()
{
    delete ui;
}

void bid::on_pushButton_clicked()
{
whole=act+","+num+","+suit;
QString str = QString::fromStdString(suit);
QString str2 = QString::fromStdString(num);
QString str3 = QString::fromStdString(act);
QStringList list;
list.append(str3);
list.append(str2);
list.append(str);
emit bidmade(list);
this->hide();
}

void bid::on_comboBox_currentIndexChanged(int index)
{
 if (index==1)
 {
    suit="H";
 }
 else if(index==2)
 {
    suit="C";
 }
 else if(index==3)
 {
    suit="S";
 }
 else if(index==4)
 {
    suit="D";
 }
 else if(index==5)
 {
    suit="NT";
 }
}

void bid::on_comboBox_2_currentIndexChanged(int index)
{
    if (index==1)
    {
       num="1";
    }
    else if(index==2)
    {
       num="2";
    }
    else if(index==3)
    {
       num="3";
    }
    else if(index==4)
    {
       num="4";
    }
    else if(index==5)
    {
       num="5";
    }
    if (index==6)
    {
       num="6";
    }
    else if(index==7)
    {
       num="7";
    }

}

void bid::on_comboBox_3_currentIndexChanged(const QString &arg1)
{


}

void bid::on_comboBox_3_currentIndexChanged(int index)
{
    if (index==1)
    {
       act="B";
    }
    else if(index==2)
    {
       act="P";
    }
    else if(index==3)
    {
       act="D";
    }
    else if(index==4)
    {
       act="RD";
    }
}
